package com.deluxelx.rmo.essay.api.res;

import com.deluxelx.rmo.common.enums.ResponseCode;
import com.deluxelx.rmo.common.result.Result;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

@Data
@EqualsAndHashCode(callSuper = true)
public class EssayRes<T> extends Result<T> implements Serializable {

    private static final long serialVersionUID = -3826891914556780628L;

    public EssayRes(String code, String info) {
        super(code, info);
    }

    public EssayRes(String code, String info, T data) {
        super(code, info, data);
    }

    public static <T> EssayRes<T> buildSuccessResult(T data) {
        return new EssayRes<T>(ResponseCode.SUCCESS.getCode(), ResponseCode.SUCCESS.getInfo(), data);
    }

}
